import {
	mapState
} from "vuex";
import {
	area
} from '@/common/api.js'
export default {
	data() {
		return {}
	},
	computed: {
		...mapState(["$userInfo", "isLogin", "areaData"]),
		columns() {
			console.log('this.areaData', this.areaData);
			return this.areaData;
		}
	},
	onShow() {},
	methods: {
		jumpPage(url) {
			if (this.isLogin) {
				uni.navigateTo({
					url
				})
			} else {
				this.$refs.login.show = true;
			}
		},
		paydata(res) {
			uni.showLoading({
				title: '支付中...'
			})
			return new Promise((resolve, reject) => {
				uni.requestPayment({
					provider: 'wxpay', // 服务提提供商
					timeStamp: res.timeStamp, // 时间戳
					nonceStr: res.nonceStr, // 随机字符串
					package: res.package,
					signType: res.signType, // 签名算法
					paySign: res.paySign, // 签名
					success: function(res) {
						console.log('支付成功', res);
						uni.hideLoading();
						resolve(1);
					},
					fail: function(err) {
						uni.hideLoading();
						console.log('支付失败', err);
						reject(0)
					}
				})
			})

		}
	}
}